package com.aloda.ojcommon.exception;

import com.aloda.ojcommon.constant.ErrorCode;
import lombok.Data;

/**
 * @Author aloda
 * @Date 2025/4/27 10:39
 */
@Data
public class AuthException extends RuntimeException{
    private Integer errorCode;

    public AuthException() {
    }

    public AuthException(String message){
        super(message);
        this.errorCode = 0;
    }

    public AuthException(Integer errorCode, String message){
        super(message);
        this.errorCode = errorCode;
    }

    public AuthException(ErrorCode errorCode){
        super(errorCode.getMessage());
        this.errorCode = errorCode.getCode();
    }
}
